#pragma once

#include <iostream>
#include <pthread.h>
using namespace std;

class lockgroup
{
public:
    lockgroup(pthread_mutex_t mutex)
    :_mutex(mutex)
    {
        pthread_mutex_lock(&_mutex);
    }

    ~lockgroup()
    {
        pthread_mutex_unlock(&_mutex);
    }
public:
    pthread_mutex_t _mutex;
};

